home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 25
/
025.d81
/
rotate sprites
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
2KB
|
65 lines
10 fori=53289to53293:pokei,0:next
20 poke53269,0:print"[147] this program takes data for 1 sprite" chr$(142)
30 print" and calculates new data"
40 print" to put sprite in different positions.":print
50 print" to use on your data"
52 print" replace data at end of program"
60 print" with your own data":print
70 print" hit a key to continue"
72 print:print" the sprite will appear at the"
74 print" top-left of the screen."
80 poke198,0:wait198,1:getk$
90 by=21:dim b(21,3),f(21,21),u(21,3), a(24,24) ,ro(24,3),sp(75),sp$(75)
100 v=53248:j=0:pokev+28,0:pokev+29,0:pokev+23,0
102 fori=1toby:fork=1to3
110 read b(i,k):sp(j)=b(i,k):j=j+1:next :next :gosub430
120 print"[147]1[146] to flip right to left"
130 print"2[146] to flip up to down "
140 print" to rotate 90 degrees "
150 print"3[146] spread data evenly over row & columns"
160 print"4[146] strip data from right of sprite"
162 print"5[146] return to loadstar"
170 if sb>4 then print"[147]out of sprites...":fordl=1to1000:next:run90
180 poke198,0:wait198,1:getk$
190 ifk$<"1"ork$>"5"then180
192 ifk$="5"then60000
200 print"[147]":b=val(k$):ti$="000000":onbgoto210,270,300,300
210 for i=1toby:fork=1to3 : s=b(i,k)
220 forp=7 to 0 step -1:print""ti$
230 if 2^p=<s then f(i,4-k)=f(i,4-k)+2^(7-p): s=s-2^p
240 next :next:next
250 j=0: for i=1toby:fork=1to3:sp(j)=f(i,k):j=j+1:next:next
260 gosub430:goto120
270 j=0: for i=1toby:print""ti$: for k=1to3
280 u(i,k)=b(by+1-i,k):sp(j)=u(i,k)
290 j=j+1:next :next:gosub430: goto120
300 q=by: for i=byto1step-1:print""ti$:fork=1to3:s=b(i,k)
310 forp=7to0step-1: a((k-1)*8+8-p,by+1-q)=0
320 if2^p<=sthena((k-1)*8+8-p,by+1-q)=1:s=s-2^p
330 nextp: next k :ifb=4then360
340 ifi/7<>int(i/7)then360
350 q=q-1:fort=1to24:a(t,by+1-q)=a(t,by-q):next t
360 q=q-1: next i
370 j=0:q=1: for r=1to21
380 if b=3and r/7=int(r/7)then q=q+1
390 forc=1to3:ro(r,c)=0:for p=7to0 step-1
400 if a(q,(c-1)*8+8-p)=1then ro(r,c)=ro(r,c)+2^p
410 next p:sp(j)=ro(r,c):j=j+1
420 nextc:q=q+1:nextr: gosub430:goto120
430 print"[147]": sb=sb+1:pw=pw+2^(sb):pokev+21,pw:poke2040+sb,220+sb:pokev+39+sb,1
440 for n=0to 62:poke14080+64*sb+n,sp(n):next
450 print"[147]":pokev+(sb*2),40*sb:pokev+(sb*2+1),50
460 print"press 'y' to see data"
470 poke198,0:wait198,1:getk$
480 if k$<>"y"then530
490 for n=0to62step9 :form=0to8 :sp$(n+m)=str$(sp(n+m))
500 printtab(4*m);sp$(n+m);:next:print: next
510 print:print"hit any key to continue"
520 get k$:ifk$=""then520
530 print"[147]": return
540 data 0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,60,0,0,126,0,0
550 data 239,0,0,135,255,224,7,255,240,3,255,252,3,255,247,1,254,227
560 data 1,249,230,1,225,96,1,34,96,1,36,224 ,1,242,128,0,8,128,0,0,0,0,0,0
60000 rem connect to ls
60010 print"[147]reconnecting...":poke53248+21,0:load"hello connect",8